The present invention generally relates to Extensible Stylesheet Language Transform (XSLT) stylesheets, and more particularly, to a visual debugger for dynamic XLS transformations.
The general flow of an XSL transformation 100 is illustrated in FIG. 1. As shown, an XSLT processor 102 reads both an Extensible Markup Language (XML) source document 104 and an XSLT stylesheet 106. Based on the instructions in the XSLT stylesheet 106, the XSLT processor 102 outputs a new XML, HyperText Markup Language (HTML), or text result document 108. In general, the XSLT stylesheet 106 specifies the transformations that need to be made to the XML source document 104 to produce the result document 108.
Developing XSLT stylesheets 106 can be complicated and error-prone due to the declarative and recursive nature of the XSLT language and other factors. Typically, the XSLT processor 102 provides as output only the result document 108 and no other useful information. If the result document 108 does not turn out as desired, the developer may not be able to determine what part of the XSLT stylesheet 106 produced the undesired results given only the result document 108, the XML source document 104, and the XSLT stylesheet 106. Visual debuggers may be used to debug XSL transformations.
The dynamic generation of XML is typically done using a Java servlet and invoking an XSLT processor to: respond to requests for XML source documents; and transform the XML source documents into HTML using an XSLT stylesheet. Consider, for example, the invocation of a simple XSLT transformation from input stream to output stream that can occur in a typical Web application, normally found inside a servlet:
  java.net.URL urlXSL = new java.net.URL(xslID);  java.net.URL urlXML = new java.net.URL(sourceID);  // Create a transform factory instance.  javax.xml.transform.TransformerFactory tfactory =javax.xml.transform.TransformerFactory.newInstance( );  javax.xml.transform.stream.StreamSource xslSource = newjavax.xml.transform.stream.StreamSource(urlXSL.openStream( ));  // for URI resolution  xslSource.setSystemId(xslID);  // Create a transformer for the stylesheet.  javax.xml.transform.Transformer transformer =tfactory.newTransformer(xslSource);  javax.xml.transform.stream.StreamSource xmlSource = newjavax.xml.transform.stream.StreamSource(urlXML.openStream( ));  // for URI resolution  xmlSource.setSystemId(sourceID);  // Transform the source XML to System.out.  transformer.transform(xmlSource, newjavax.xml.transform.stream.StreamResult(System.out));
Using known Java debuggers, a user is able to step through the servlet and into the XSL transformation (provided it is written in Java).